<!--
 * @Description: 子子组件
 * @Date: 2022-06-27 14:51:08
 * @LastEditTime: 2023-09-02 12:26:45
 * @FilePath: /demo_cesium/src/views/Map/compontent/son/Sons.vue
 * @Author: byhzdemacbook-pro-2.local
-->
<template>
  <div>
    <div
      class="map"
      ref="maps"
    ></div>
  </div>
</template>

<script>
export default {
  name: '',
  components: {

  },
  props: {

  },
  data() {
    return {

    };
  },
  computed: {

  },
  watch: {

  },
  created() {

  },
  mounted() {
    console.log("Cesium------------->", Cesium);
    const viewer = new Cesium.Viewer(this.$refs.maps);
    // 加载点云数据
    // const pointCloudData = [
    //   { x: 0, y: 0, z: 0 },
    //   { x: 1, y: 1, z: 1 },
    //   { x: -1, y: -1, z: -1 }
    // ];

    // const positions = [];
    // pointCloudData.forEach(point => {
    //   positions.push(point.x, point.y, point.z);
    // });

    // const pointCloud = new Cesium.PointCloud({
    //   positions: positions,
    //   color: Cesium.Color.GREEN,
    //   size: 12
    // });

    // viewer.scene.primitives.add(pointCloud);

    
    // 调整相机视野以适应点云数据
    viewer.zoomTo(pointCloud);
  },
  methods: {

  },
};
</script>

<style scoped>
.map {
  width: 100%;
  height: 500px;
}
</style>
